package com.ruoyi.btlfbreed.service.impl;

import java.util.List;

import com.ruoyi.btlfbreed.domain.MyTbChickensVO;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.btlfbreed.mapper.TbChickensMapper;
import com.ruoyi.btlfbreed.domain.TbChickens;
import com.ruoyi.btlfbreed.service.ITbChickensService;

/**
 * 肉鸡Service业务层处理
 * 
 * @author codeman
 * @date 2024-05-05
 */
@Service
public class TbChickensServiceImpl implements ITbChickensService 
{
    @Autowired
    private TbChickensMapper tbChickensMapper;

    /**
     * 查询肉鸡
     * 
     * @param chickenId 肉鸡主键
     * @return 肉鸡
     */
    @Override
    public TbChickens selectTbChickensByChickenId(Long chickenId)
    {
        return tbChickensMapper.selectTbChickensByChickenId(chickenId);
    }

    /**
     * 查询肉鸡列表
     * 
     * @param tbChickens 肉鸡
     * @return 肉鸡
     */
    @Override
    public List<TbChickens> selectTbChickensList(TbChickens tbChickens)
    {
        return tbChickensMapper.selectTbChickensList(tbChickens);
    }

    /**
     * 新增肉鸡
     * 
     * @param tbChickens 肉鸡
     * @return 结果
     */
    @Override
    public int insertTbChickens(TbChickens tbChickens)
    {
        tbChickens.setCreateTime(DateUtils.getNowDate());
        return tbChickensMapper.insertTbChickens(tbChickens);
    }

    /**
     * 修改肉鸡
     * 
     * @param tbChickens 肉鸡
     * @return 结果
     */
    @Override
    public int updateTbChickens(TbChickens tbChickens)
    {
        tbChickens.setUpdateTime(DateUtils.getNowDate());
        return tbChickensMapper.updateTbChickens(tbChickens);
    }

    /**
     * 批量删除肉鸡
     * 
     * @param chickenIds 需要删除的肉鸡主键
     * @return 结果
     */
    @Override
    public int deleteTbChickensByChickenIds(Long[] chickenIds)
    {
        return tbChickensMapper.deleteTbChickensByChickenIds(chickenIds);
    }

    /**
     * 删除肉鸡信息
     * 
     * @param chickenId 肉鸡主键
     * @return 结果
     */
    @Override
    public int deleteTbChickensByChickenId(Long chickenId)
    {
        return tbChickensMapper.deleteTbChickensByChickenId(chickenId);
    }

    @Override
    public List<MyTbChickensVO> getChickenData(String chickenId)
    {
        return tbChickensMapper.getChickenData(chickenId);
    }
}
